/*
 * Helper.h
 *
 *  Created on: May 27, 2011
 *      Author: Ernest Mashele <mashern@gmail.com>
 */

#ifndef HELPER_H_
#define HELPER_H_

#pragma once

// DirectX Linking :
#pragma comment(lib, "d3dx10.lib")
#pragma comment(lib, "d3d10.lib")
#pragma comment(lib, "dxerr.lib")

// DirectX Header Files :
#include <D3DX10.h>
#include <D3D10.h>
#include <DxErr.h>

// Windows Header Files :
#include <Windows.h>

// C RunTime Header Files :
#include <tchar.h>
#include <stdlib.h>
#include <stdio.h>

#include <string>
#include <fstream>
#include <vector>

// Safe Release COM Objects
template<class T>
void __inline SafeRelease(T *object)
{
	if (object)
	{
		object->Release();
		object = NULL;
	}
}

template<class T>
void __inline ReleaseClass(T *object)
{
	if (object)
	{
		delete object;
		object = NULL;
	}
}

// Display an Error msg:
bool Error(LPWSTR errorMsg);

// Main Window handle
extern HWND hWnd;

// Colours
const D3DXVECTOR4 kBackground(1.0f, 1.0f, 1.0f, 1.0f);

#endif /* HELPER_H_ */
